package com.test.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Controller
public class UserController {
	@Resource
	HttpServletRequest request;
	
	@PostMapping("/logout")
	public @ResponseBody void logout(){
		//清除session中存储的数据
		request.getSession().invalidate();
	}
}
